﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Item.aspx.cs" Inherits="Directory.Web.Admin_Item"
    Theme="Admin_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>条目管理</title>

    <script type="text/javascript">
        function $(id) {
            return document.getElementById(id);
        }
        var logoWindow = null;
        function ShowLogoView() {
            //document.getElementById('logoViewFrame').style.display = '';
            logoWindow = window.open("logoview.aspx", "选择Logo", null, false);
        }
        function SetLogoPath(fullpath) {
            //document.getElementById('logoViewFrame').style.display = 'none';
            document.getElementById('LogoPath').value = fullpath;
            document.getElementById('LogoImg').src = document.getElementById('LogoBasePath').value + fullpath;
            HideLogoView();
        }
        function HideLogoView() {
            //document.getElementById('logoViewFrame').style.display = 'none';
            try {
                logoWindow.close();
            } catch (e) {
            }
        }
        function HideLoadingState() {
            $('loadingState').style.display = 'none';
        }
        function FrameLoaded() {
            HideLoadingState();
            var ifrm = document.getElementById('logoViewFrame');
            var height_doc = parseInt(ifrm.contentWindow.document.body.scrollHeight);
            var height_parnent = parseInt(ifrm.parentNode.offsetHeight);
            if (height_doc > height_parnent) {
                ifrm.style.height = height_doc + 'px';
            } else {
                ifrm.style.height = height_parnent + 'px';
            }
        }
        function NavUrl(url) {
            window.location = url;
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div class="container">
        <asp:Panel ID="pnlDetail" runat="server">
            <table>
                <tr>
                    <td>
                        <label>
                            <% = Resources.Resource.ResourceManager.GetString("ItemTitle") %></label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbTitle" runat="server" Width="250"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            <% = Resources.Resource.ResourceManager.GetString("Category") %></label>
                    </td>
                    <td>
                        <DirectoryControl:CascadingCategory ID="CascadingCategory" runat="server" />
                    </td>
                </tr>
                <tr style="display: none;">
                    <td>
                        <label>
                            <% = Resources.Resource.ResourceManager.GetString("ItemKeyWords") %></label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbkeyWords" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            <% = Resources.Resource.ResourceManager.GetString("ItemDescription") %></label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbDescription" runat="server" TextMode="MultiLine" Rows="5"
                            Width="350px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            <% = Resources.Resource.ResourceManager.GetString("ItemLinkUrl") %></label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbLinkUrl" runat="server" Width="300px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            <% = Resources.Resource.ResourceManager.GetString("ItemLogo") %></label>
                    </td>
                    <td>
                        <%--<input type="hidden" id="LogoPath" name="LogoPath" value="<%= rawLogoPath %>" />
                        <input type="hidden" id="LogoBasePath" value="<%= logoBasePath %>" />
                        <img id="LogoImg" src='' alt='logo' />
                        <a id='selectlogoLink' href="logoview.aspx" target="logoViewFrame" onclick="ShowLogoView()">
                            选择<% = Resources.Resource.ResourceManager.GetString("ItemLogo")%></a>--%>
                        <asp:TextBox ID="tbLogopath" runat="server" Width="300"></asp:TextBox> 
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            <% = Resources.Resource.ResourceManager.GetString("ItemTopState")%></label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbTopState" runat="server" Text="0" Width="60"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="tbTopState"
                            ValidationExpression="\d"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <center>
                            <asp:Button ID="btn_Add" runat="server" OnClick="btn_Add_Click" Text="添 加" />
                            <asp:Button ID="btn_Save" runat="server" OnClick="btn_Save_Click" Text="保 存" />
                            <asp:Button ID="btn_Check" runat="server" OnClick="btn_Check_Click" Text="通过审核" />
                            <input type="button" onclick="NavUrl('<% = this.reffUrl %>')" value="取消" class="input_Button" />
                            <asp:Button ID="btn_Delete" runat="server" OnClick="btn_Delete_Click" Text="删 除" />
                            <asp:Literal ID="ltMsg" runat="server"></asp:Literal>
                        </center>
                    </td>
                </tr>
            </table>

            <script type="text/javascript">
                SetLogoPath(document.getElementById('LogoPath').value);
            </script>

        </asp:Panel>
        <asp:Panel ID="pnlBatchAdd" runat="server" Height="300">
            <table>
                <colgroup>
                    <col width="40%" />
                    <col width="60%" />
                </colgroup>
                <tr>
                    <td colspan="2">
                        <span class="FL">所属<% = Resources.Resource.ResourceManager.GetString("Category") %>：</span>
                        <DirectoryControl:CascadingCategory ID="CascadingCategory_bat" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <fieldset>
                            <legend>
                                <% = Resources.Resource.ResourceManager.GetString("ItemTitle")%></legend>
                            <asp:TextBox ID="tbTitleBat" runat="server" TextMode="MultiLine" Width="100%" Rows="10"></asp:TextBox>
                        </fieldset>
                    </td>
                    <td>
                        <fieldset>
                            <legend>
                                <% = Resources.Resource.ResourceManager.GetString("ItemLinkUrl") %></legend>
                            <asp:TextBox ID="tbLinkUrlBat" runat="server" TextMode="MultiLine" Width="100%" Rows="10"></asp:TextBox>
                        </fieldset>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Button ID="btnBatchAdd" runat="server" Text="添 加" OnClick="btnBatchAdd_Click" />
                        <input type="button" onclick="NavUrl('<% = this.reffUrl %>')" value="取消" class="input_Button" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <div id="loadingState" style="display: none;">
        </div>
        <iframe id="logoViewFrame" name="logoViewFrame" frameborder="0" style="display: none;"
            onload="FrameLoaded();"></iframe>
    </div>
    </form>
</body>
</html>
